Activity Store topic

Use the activity store module to keep recorded activities on the device and sync them with a backend. The local store is the system of record and works offline; sync, sharing and profile updates run in the background and report through listener events.

  • ActivityStore: Use this store to insert, list, update and delete activities, attach files to them, keep the user profile, and keep the shared activities a user opened from links. Hand over the session of your sign-in flow with setSession to enable profile sync, and activity sync and sharing when ActivityStoreConfig.syncEnabled is true.
  • ActivityStoreConfig: Use this configuration to set where the local store lives, the backend endpoints and the master switch of the activity network features.
  • Activity: Use this record to describe an activity: its sport, effort and visibility, times, metrics, attached files and social data.
  • UserProfile: Use this record to read and edit the user's profile, including the avatar.
  • ActivityStoreListener: Use this listener to follow uploads, fetches, shared activity resolves, profile sync and session expiry.

Typical workflow: create an ActivityStore with an ActivityStoreConfig, add an ActivityStoreListener, hand over the session with setSession, then insert recorded activities with their exported track and read them back with listLocalActivities. Every store method runs on the SDK thread and reports its outcome through its onComplete callback.

Classes

Activity Activity Store
An activity kept by an ActivityStore: identity, description, times, metrics, files and social data.
ActivityComment Activity Store
A comment on an Activity.
ActivityLike Activity Store
A like given to an Activity.
ActivityMetrics Activity Store
Summary metrics of an Activity.
ActivitySocial Activity Store
The likes and comments of an Activity.
ActivityStore Activity Store
Local-first activity storage, synced with the backend.
ActivityStoreConfig Activity Store
Storage and backend settings of an ActivityStore.
ActivityStoreListener Activity Store
Listener for the asynchronous events of an ActivityStore: uploads, fetches, shared activity resolves, profile sync and session expiry.
StoredActivityFile Activity Store
A file attached to an Activity: the canonical recorded track, a route thumbnail or a media file.
UserProfile Activity Store
A user's profile, kept locally and synced like the activities, one per user.

Enums

ActivityFileType Activity Store
The type of a file attached to an Activity.
ActivityStoreResult Activity Store
The outcome of an asynchronous ActivityStore operation, reported to an ActivityStoreListener.